<div class="refentry"><a id="glProvokingVertex"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glProvokingVertex — specifiy the vertex to be used as the source of data for flat shaded varyings</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table class="funcprototype-table" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">void <strong class="fsfunc">glProvokingVertex</strong>(</code></td><td>GLenum <var class="pdparam">provokeMode</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>provokeMode</code></em></span></dt><dd><p>
                    Specifies the vertex to be used as the source of data for flat shaded varyings.
                </p></dd></dl></div></div><div class="refsect1"><a id="description"></a><h2>Description</h2><p>
            <span class="emphasis"><em>Flatshading</em></span> a vertex shader varying output means to assign all vetices of the primitive the same value
            for that output. The vertex from which these values is derived is known as the <span class="emphasis"><em>provoking vertex</em></span> and
            <code class="function">glProvokingVertex</code> specifies which vertex is to be used as the source of data for flat shaded varyings.
        </p><p>
            <em class="parameter"><code>provokeMode</code></em> must be either <code class="constant">GL_FIRST_VERTEX_CONVENTION</code> or
            <code class="constant">GL_LAST_VERTEX_CONVENTION</code>, and controls the selection of the vertex whose values are assigned to flatshaded
            varying outputs. The interpretation of these values for the supported primitive types is:
            </p><div class="informaltable"><table><colgroup><col /><col /><col /></colgroup><thead><tr><th><span class="bold"><strong>
                            Primitive Type of Polygon <span class="emphasis"><em>i</em></span>
                            </strong></span></th><th><span class="bold"><strong>
                            First Vertex Convention
                            </strong></span></th><th><span class="bold"><strong>
                            Last Vertex Convention
                            </strong></span></th></tr><tr><th>
                                point
                            </th><th>
                                <span class="emphasis"><em>i</em></span>
                            </th><th>
                                <span class="emphasis"><em>i</em></span>
                            </th></tr><tr><th>
                                independent line
                            </th><th>
                                2<span class="emphasis"><em>i</em></span> - 1
                            </th><th>
                                2<span class="emphasis"><em>i</em></span>
                            </th></tr><tr><th>
                                line loop
                            </th><th>
                                <span class="emphasis"><em>i</em></span>
                            </th><th>
                                <p>
                                <span class="emphasis"><em>i</em></span> + 1, if <span class="emphasis"><em>i</em></span> &lt; <span class="emphasis"><em>n</em></span>
                                </p>
                                <p>
                                1, if <span class="emphasis"><em>i</em></span> = <span class="emphasis"><em>n</em></span>
                                </p>
                            </th></tr><tr><th>
                                line strip
                            </th><th>
                                <span class="emphasis"><em>i</em></span>
                            </th><th>
                                <span class="emphasis"><em>i</em></span> + 1
                            </th></tr><tr><th>
                                independent triangle
                            </th><th>
                                3<span class="emphasis"><em>i</em></span> - 2
                            </th><th>
                                3<span class="emphasis"><em>i</em></span>
                            </th></tr><tr><th>
                                triangle strip
                            </th><th>
                                <span class="emphasis"><em>i</em></span>
                            </th><th>
                                <span class="emphasis"><em>i</em></span> + 2
                            </th></tr><tr><th>
                                triangle fan
                            </th><th>
                                <span class="emphasis"><em>i</em></span> + 1
                            </th><th>
                                <span class="emphasis"><em>i</em></span> + 2
                            </th></tr><tr><th>
                                line adjacency
                            </th><th>
                                4<span class="emphasis"><em>i</em></span> - 2
                            </th><th>
                                4<span class="emphasis"><em>i</em></span> - 1
                            </th></tr><tr><th>
                                line strip adjacency
                            </th><th>
                                <span class="emphasis"><em>i</em></span> + 1
                            </th><th>
                                <span class="emphasis"><em>i</em></span> + 2
                            </th></tr><tr><th>
                                triangle adjacency
                            </th><th>
                                6<span class="emphasis"><em>i</em></span> - 5
                            </th><th>
                                6<span class="emphasis"><em>i</em></span> - 1
                            </th></tr><tr><th>
                                triangle strip adjacency
                            </th><th>
                                2<span class="emphasis"><em>i</em></span> - 1
                            </th><th>
                                2<span class="emphasis"><em>i</em></span> + 3
                            </th></tr></thead></table></div><p>
        </p><p>
            If a vertex or geometry shader is active, user-defined varying outputs may be flatshaded by using the
            <code class="code">flat</code> qualifier when declaring the output.
        </p></div><div class="refsect1"><a id="notes"></a><h2>Notes</h2><p>
            <code class="function">glProvokingVertex</code> is available only if the GL version is 3.2 or greater.
        </p></div><div class="refsect1"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>provokeMode</code></em> is not an accepted value.
        </p></div><div class="refsect1"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 2010 Khronos Group.
            This material may be distributed subject to the terms and conditions set forth in
            the Open Publication License, v 1.0, 8 June 1999.
            <a class="ulink" href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
        </p></div></div></div>
